<?php namespace Home\Controller; 

class ContentController extends CommonController{
      public function index(){
      	$aid = Q("get.aid",0,"intval");
   //Aid具体的是那一个文章
       $data =Db::table("article")->where("is_recycle",0)
    	->join("category","cid","=","category_cid")
		  ->join("article_data","article_aid","=","aid")
		  ->where("aid",$aid)
    	->get();
		  foreach ($data as $k => $v) {
			  	$data[$k]['tag'] = Db::table("article_tag")
				->join("tag","tid","=","tag_tid")
				->where("article_aid",$v['aid'])
				->lists("tid,tname");
			
			  }
		   View::with("data",$data);
       View::make();
	}
	
}
